package com.iflytek.exam.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iflytek.exam.mapper.ShortAnswerMapper;
import com.iflytek.exam.domain.ShortAnswer;
import com.iflytek.exam.service.IShortAnswerService;

/**
 * 简答题Service业务层处理
 *
 * @author Dogdog
 * @date 2024-07-07
 */
@Service
public class ShortAnswerServiceImpl implements IShortAnswerService
{
    @Autowired
    private ShortAnswerMapper shortAnswerMapper;

    /**
     * 查询简答题
     *
     * @param id 简答题主键
     * @return 简答题
     */
    @Override
    public ShortAnswer selectShortAnswerById(Long id)
    {
        return shortAnswerMapper.selectShortAnswerById(id);
    }

    @Override
    public ShortAnswer selectShortAnswerByTitle(String title) {
        return shortAnswerMapper.selectShortAnswerByTitle(title);
    }

    /**
     * 查询简答题列表
     *
     * @param shortAnswer 简答题
     * @return 简答题
     */
    @Override
    public List<ShortAnswer> selectShortAnswerList(ShortAnswer shortAnswer)
    {
        return shortAnswerMapper.selectShortAnswerList(shortAnswer);
    }

    /**
     * 新增简答题
     *
     * @param shortAnswer 简答题
     * @return 结果
     */
    @Override
    public int insertShortAnswer(ShortAnswer shortAnswer)
    {
        return shortAnswerMapper.insertShortAnswer(shortAnswer);
    }

    /**
     * 修改简答题
     *
     * @param shortAnswer 简答题
     * @return 结果
     */
    @Override
    public int updateShortAnswer(ShortAnswer shortAnswer)
    {
        return shortAnswerMapper.updateShortAnswer(shortAnswer);
    }

    /**
     * 批量删除简答题
     *
     * @param ids 需要删除的简答题主键
     * @return 结果
     */
    @Override
    public int deleteShortAnswerByIds(Long[] ids)
    {
        return shortAnswerMapper.deleteShortAnswerByIds(ids);
    }

    /**
     * 删除简答题信息
     *
     * @param id 简答题主键
     * @return 结果
     */
    @Override
    public int deleteShortAnswerById(Long id)
    {
        return shortAnswerMapper.deleteShortAnswerById(id);
    }

    @Override
    public Long[] getAllShortAnswerIds(long quBankId) {
        return shortAnswerMapper.getAllShortAnswerIds(quBankId);
    }
}
